import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        int count = 0;
        for(int i=1;i <= n;i++) {
            if(goodCount(i)) {
                count++;
            }
        }
        System.out.println(count);
        scan.close();
    }
    public static boolean goodCount(int a) {
        int count = 0;
        while(a > 10) {
            int tmp = a%10;
            a = a/10;
            if(count%2 == 0 && tmp%2 == 0) {
                return false;
            }
            if(count%2 != 0 && tmp%2 != 0) {
                return false;
            }
            count++;
        }
        return true;
    }
}
